package tx.algoritmiek.week1;

public class RecursiveFormula implements BinomialFormula {

    public double executeFormula(double n, double k) {
        if(n < k || n < 0 || k < 0) {
            return 0;
        } else if(k <= 1) {
            return n;
        } else {
            return n / k * executeFormula(n-1, k-1);
        }
    }
}
